# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
#   Mayor.create(:name => 'Daley', :city => cities.first)
Warehouse.create(:company_id =>'1',:number=>'1001',:name=>'成品仓库')
Warehouse.create(:company_id =>'1',:number=>'1002',:name=>'半成品仓库')
Warehouse.create(:company_id =>'1',:number=>'1003',:name=>'原料仓库')

Vendor.create(:company_id =>'1',:number =>'1001',:name=>'罗雅蒂施化妆品有限公司',:linkman=>'刘邦',:phone=>'88888888')
Vendor.create(:company_id =>'1',:number =>'1002',:name=>'中科院生物所',:linkman=>'萧何',:phone=>'66666666')
    
Customer.create(:company_id =>'1',:number =>'1001',:name=>'山东代理商',:phone=>'88606680',:linkman=>'刘基',:address=>'青岛崂山区')
Customer.create(:company_id =>'1',:number =>'1002',:name=>'山西代理商',:phone=>'88606680',:linkman=>'冯胜',:address=>'太原崂山区')
Customer.create(:company_id =>'1',:number =>'1003',:name=>'浙江代理商',:phone=>'88606680',:linkman=>'李善长',:address=>'杭州崂山区')
Customer.create(:company_id =>'1',:number =>'1004',:name=>'四川代理商',:phone=>'88606680',:linkman=>'李文忠',:address=>'成都崂山区')
Customer.create(:company_id =>'1',:number =>'1005',:name=>'河北代理商',:phone=>'88606680',:linkman=>'邓愈',:address=>'北京崂山区')

Department.create(:company_id =>'1',:name => '市场部')
Department.create(:company_id =>'1',:name => '仓储部')
Department.create(:company_id =>'1',:name => '会计部')

Employee.create(:company_id =>'1',:department_id=>'1',:number =>'1001',:name=>'Mike',:password=>'111111',:role_id=>1)
Employee.create(:company_id =>'1',:department_id=>'1',:number =>'1002',:name=>'Jerry',:password=>'111111',:role_id=>2)
Employee.create(:company_id =>'1',:department_id=>'2',:number =>'1003',:name=>'MWT',:password=>'111111',:role_id=>3)

Company.create(:number =>'10001',:name => '优度',:phone => '0532-88888888',:fax=>'0532-99999999',:linkman=>'Jerry',:email=>'youdo@gmail.com',:address=>'青岛')

TransportMode.create(:name =>'空运')
TransportMode.create(:name =>'铁路')
TransportMode.create(:name =>'汽车')
TransportMode.create(:name =>'海运')
TransportMode.create(:name =>'快递')

OrderType.create(:sub_type => 0 ,:name => '未选择单据类型')
OrderType.create(:sub_type => 1 ,:name => '采购单')
OrderType.create(:sub_type => 1 ,:name => '入库单')
OrderType.create(:sub_type => 2 ,:name => '销售订单')
OrderType.create(:sub_type => 2 ,:name => '出库单')

Product.create(:company_id =>'1',:number=>'1001',:name=>'102-A-冻干粉',:spec=>'3ml',:unit=>'支',:unit_price=>'5',:vendor_id=>'1',:is_suit=>0)
Product.create(:company_id =>'1',:number=>'1002',:name=>'102-A-溶酶',:spec=>'3ml',:unit=>'支',:unit_price=>'5',:vendor_id=>'2',:is_suit=>0)
Product.create(:company_id =>'1',:number=>'1003',:name=>'EGF，2万IU',:spec=>'5ml',:unit=>'支',:unit_price=>'10',:vendor_id=>'1',:is_suit=>0)
Product.create(:company_id =>'1',:number=>'1004',:name=>'EGF，5万IU',:spec=>'5ml',:unit=>'支',:unit_price=>'20',:vendor_id=>'2',:is_suit=>0)
Product.create(:company_id =>'1',:number=>'1005',:name=>'MS-102基因抗衰II型',:unit_price=>'60',:vendor_id=>'2',:product_type=>'suit',:is_suit=>1)
Product.create(:company_id =>'1',:number=>'1006',:name=>'MH-303修复再生加强型',:unit_price=>'80',:vendor_id=>'2',:product_type=>'suit',:is_suit=>1)
Product.create(:company_id =>'1',:number=>'1007',:name=>'抗衰套组II',:unit_price=>'140',:vendor_id=>'2',:product_type=>'suit',:is_suit=>1)

ProductsComponent.create(:product_id =>5,:component_id=>1,:quantity=>2)
ProductsComponent.create(:product_id =>5,:component_id=>2,:quantity=>2)
ProductsComponent.create(:product_id =>6,:component_id=>3,:quantity=>3)
ProductsComponent.create(:product_id =>6,:component_id=>4,:quantity=>3)
ProductsComponent.create(:product_id =>7,:component_id=>5)
ProductsComponent.create(:product_id =>7,:component_id=>6)

Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'RK',:sub_type=>'WarehousingEntry')      #入库
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'CK',:sub_type=>'DeliveryOrder')         #出库
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'CF',:sub_type=>'SeparateOrder')         #拆分
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'ZH',:sub_type=>'AssemblyOrder')         #组合
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'DH',:sub_type=>'TransferOrder')         #调货
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'XS',:sub_type=>'SaleOrder')             #销售
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'CG',:sub_type=>'PurchaseOrder')         #采购
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'TH',:sub_type=>'OpeningStock')          #退货
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'CT',:sub_type=>'PurchaseReturned')      #采购退货
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'SP',:sub_type=>'Claim')                 #索赔
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'JH',:sub_type=>'Loan')                  #借货
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'SF',:sub_type=>'ClaimReturned')         #索赔返库
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'JHCK',:sub_type=>'LoanDelivery')        #贷货出库
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'JF',:sub_type=>'LoanReturned')          #借货返库
Sequence.create(:company_id =>1, :seq_no =>'0',:ab=>'PD',:sub_type=>'Inventory')             #盘点

Role.create(:company_id=>1,:name =>'管理员')
Role.create(:company_id=>1,:name =>'超级管理员')